$OpenBSD: patch-src_Makefile_in,v 1.4 2008/11/08 22:09:40 sthen Exp $
--- src/Makefile.in.orig	Thu Mar 11 18:50:20 2004
+++ src/Makefile.in	Sat Nov  8 22:07:59 2008
@@ -43,10 +43,10 @@ datadir = @datadir@
 sysconfdir = @sysconfdir@
 sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
-libdir = @libdir@
+libdir = @libdir@/libnet-1.1
 infodir = @infodir@
 mandir = @mandir@
-includedir = @includedir@
+includedir = @includedir@/libnet-1.1
 oldincludedir = /usr/include
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -109,8 +109,10 @@ AUTOMAKE_OPTIONS = foreign no-dependencies
 
 DISTCLEANFILES = *~
 
-lib_LIBRARIES = libnet.a
+SHLIB= libnet.so.$(LIBnet_VERSION)
 
+lib_LIBRARIES = libnet.a $(SHLIB)
+
 libnet_a_SOURCES = libnet_asn1.c \
 			libnet_build_802.1q.c \
 			libnet_build_802.1x.c \
@@ -203,6 +205,8 @@ am_libnet_a_OBJECTS = libnet_asn1.$(OBJEXT) \
 	libnet_raw.$(OBJEXT) libnet_resolve.$(OBJEXT) \
 	libnet_version.$(OBJEXT) libnet_write.$(OBJEXT)
 libnet_a_OBJECTS = $(am_libnet_a_OBJECTS)
+SHOBJECTS=	$(am_libnet_a_OBJECTS:S/.o/.so/) $(libnet_a_LIBADD:S/.o/.so/)
+PICFLAG= -fPIC
 
 DEFS = @DEFS@
 DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)/include
@@ -226,7 +230,7 @@ SOURCES = $(libnet_a_SOURCES) $(EXTRA_libnet_a_SOURCES
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .c .o .so .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
 	cd $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign  src/Makefile
@@ -249,8 +253,6 @@ install-libLIBRARIES: $(lib_LIBRARIES)
 	@list='$(lib_LIBRARIES)'; for p in $$list; do \
 	  if test -f $$p; then \
 	    p="`echo $$p | sed -e 's|^.*/||'`"; \
-	    echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \
-	    $(RANLIB) $(DESTDIR)$(libdir)/$$p; \
 	  else :; fi; \
 	done
 
@@ -269,6 +271,10 @@ libnet.a: $(libnet_a_OBJECTS) $(libnet_a_DEPENDENCIES)
 	$(libnet_a_AR) libnet.a $(libnet_a_OBJECTS) $(libnet_a_LIBADD)
 	$(RANLIB) libnet.a
 
+$(SHLIB): $(SHOBJECTS) $(libnet_a_DEPENDENCIES) 
+	-rm -f $(SHLIB)
+	$(CC) -shared $(PICFLAG) -o $(SHLIB) $(SHOBJECTS)
+
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT) core *.core
 
@@ -277,6 +283,9 @@ distclean-compile:
 
 .c.o:
 	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.so:
+	$(COMPILE) $(PICFLAG) -DPIC -c `test -f '$<' || echo '$(srcdir)/'`$< -o $@
 
 .c.obj:
 	$(COMPILE) -c `cygpath -w $<`
